package cn.zhoujing.security.demo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.zhoujing.security.demo.entity.UserRoleLink;
import cn.zhoujing.security.demo.service.UserRoleLinkService;
import cn.zhoujing.security.demo.mapper.UserRoleLinkMapper;
import org.springframework.stereotype.Service;

import java.util.Set;

/**
* @author JingZhou
* @description 针对表【user_role_link】的数据库操作Service实现
* @createDate 2024-02-12 22:51:55
*/
@Service
public class UserRoleLinkServiceImpl extends ServiceImpl<UserRoleLinkMapper, UserRoleLink>
    implements UserRoleLinkService{

    /**
     * 根据用户id获取角色名称
     * @param userId 用户id
     * @return 角色名称
     */
    @Override
    public Set<String> getRoleCodesByUserId(long userId) {
        return baseMapper.selectRoleCodesByUserId(userId);
    }

}




